//
//  MyAlertView.m
//  kankanVideo
//
//  Created by wangbo on 6/19/12.
//  Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//

#import "MyAlertView.h"
#import <QuartzCore/QuartzCore.h>

@implementation MyAlertView

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        // Initialization code
    }
    self.transform=CGAffineTransformMakeRotation((180*M_PI)/360);
    backView=[[UIView alloc]initWithFrame:CGRectMake(0, 0, frame.size.width, frame.size.height)];
    backView.layer.cornerRadius=10;
    [backView setBackgroundColor:[UIColor blackColor]];
    [backView setAlpha:0.7];
    [self addSubview:backView];
    [backView release];
    
    lblTitle=[[UILabel alloc]initWithFrame:CGRectMake(0, frame.size.height/2-30/2, frame.size.width, 30)];
    lblTitle.text=@"测试";
    [lblTitle setTextAlignment:UITextAlignmentCenter];
    lblTitle.textColor=[UIColor whiteColor];
    [lblTitle setBackgroundColor:[UIColor clearColor]];
    
    [self addSubview:lblTitle];
    [lblTitle release];
    NSLog(@"myalertview_lbltitle_init:%d",lblTitle.retainCount);
    
    return self;
}

-(void)setTitle:(NSString *)theTitle{
    self.transform=CGAffineTransformMakeRotation((180*M_PI)/360);
    lblTitle.text=theTitle;
}

-(void)dealloc{
    [backView release];
    [lblTitle release];
    [super dealloc];
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect
{
    // Drawing code
}
*/

@end
